//
//  DeliveryBoxViewController.m
//  CYWFrame
//
//  Created by 于顺燊 on 2018/9/25.
//  Copyright © 2018年 Macx. All rights reserved.
//

#import "DeliveryBoxViewController.h"
#import "DeliveredResumeTableViewCell.h"
#import "DeliveredJobListTableViewCell.h"
#import "CCZSegementController2.h"
#import "DeliveryBoxTableViewController.h"

@interface DeliveryBoxViewController ()

@property (strong, nonatomic) NSMutableArray *jobArr;
@property (strong, nonatomic) NSMutableArray *resumeArr;


@end

@implementation DeliveryBoxViewController

- (void)viewWillAppear:(BOOL)animated
{
	
}

- (void)viewDidLoad {
	[super viewDidLoad];
	
	// Do any additional setup after loading the view.
	[self createUI];
	
}

- (void)createUI {

	self.navigationItem.title = @"投递箱";
	self.view.backgroundColor = kWhiteColor;
	CCZSegementController2 *segment;
	NSInteger role = [GetUserDefaule(USERINFO)[@"role"] integerValue];
	if (role == 2 || role == 4) {
		segment = [CCZSegementController2 segementControllerWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT) titles:@[@"我的投递",@"收到邀约"]];
		DeliveryBoxTableViewController *vc1 = [[DeliveryBoxTableViewController alloc] init];
		vc1.type = 0;
		DeliveryBoxTableViewController *vc2 = [[DeliveryBoxTableViewController alloc] init];
		vc2.type = 1;
		[segment setViewControllers:@[vc1,vc2]];
	}
	else if(role == 5 || role == 6){
		segment = [CCZSegementController2 segementControllerWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT) titles:@[@"我的邀约",@"收到投递"]];
		DeliveryBoxTableViewController *vc1 = [[DeliveryBoxTableViewController alloc] init];
		vc1.type = 1;
		DeliveryBoxTableViewController *vc2 = [[DeliveryBoxTableViewController alloc] init];
		vc2.type = 0;
		[segment setViewControllers:@[vc1,vc2]];
	}
	[segment setSegementTintColor:UIMainColorRGB];
	segment.style = CCZSegementStyleDefault;
	[segment setSelectedItemAtIndex:self.defaultIndex];
	[self.view addSubview:segment.view];
	[self addChildViewController:segment];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
